<?php
//+----------------------------------------------------
//| 工具类: 订单工具类
//| Author: web_dxj@163.com
//+----------------------------------------------------

namespace Api\Libs;

class OrderUtil {


	/**
	 * 生成16位订单号
	 * @return string 返回生成的16位订单号
	 */
	public static function create_order_code() {
		$year_code = array (
			'A',
			'B',
			'C',
			'D',
			'E',
			'F',
			'G',
			'H',
			'I',
			'J' 
		);
		$order_sn = $year_code [intval ( date ( 'Y' ) ) - 2010] . strtoupper ( dechex ( date ( 'm' ) ) ) . date ( 'd' ) . substr ( time (), - 5 ) . substr ( microtime (), 2, 5 ) . sprintf ( '%02d', rand ( 0, 99 ) );
		return $order_sn;
	}

}